min_id = 1;
max_id = 9;

cur_style = 0;

left_arrow      = document.getElementById("left_arrow");
right_arrow     = document.getElementById("right_arrow");
image_frame     = document.getElementById("image_frame");
detail_frame    = document.getElementById("detail_frame");
style_changer   = document.getElementById("style_changer");

regex = /\d/;
image_frame.src = "image/" + min_id + ".jpg";
detail_frame.src = "detail/" + min_id + ".htm";
window.GET();
for (var get_var in window._GET){
    next = window._GET[get_var];
    image_frame.src = "image/" + next + ".jpg";
    detail_frame.src = "detail/" + next + ".htm";
}

left_arrow.addEventListener("click", function (){
    
    current = image_frame.src.match(regex);
    next = current - 1;
    //document.getElementById("cek").innerHTML=next;
    if (next < min_id) next = min_id;
    image_frame.src = "image/" + next + ".jpg";
    detail_frame.src = "detail/" + next + ".htm";
}, false);

right_arrow.addEventListener("click", function (){
    current = image_frame.src.match(regex);
    next = parseInt(current) +1;
    //document.getElementById("cek").innerHTML=next;
    if (next > max_id) next = max_id;
    image_frame.src = "image/" + next + ".jpg";
    detail_frame.src = "detail/" + next + ".htm";
}, false);
